{template '_header'}

    <div class="page-header">

        当前位置：<span class="text-primary">商品组商品管理</span>
    </div>
<div class="page-content" style="display: block;">
    <form action="./index.php" method="get" class="form-horizontal form-search" role="form">
        <input type="hidden" name="c" value="site">
        <input type="hidden" name="a" value="entry">
        <input type="hidden" name="m" value="mx_shop">
        <input type="hidden" name="do" value="web">
        <input type="hidden" name="r" value="store.goodsgroup.goods">
        <input type="hidden" name="id" value="{$id}">

        <div class="page-toolbar">
            <div class="col-sm-6" >
                <a class="btn btn-default" href="{php echo webUrl('store/goodsgroup');}">返回商品组</a>

                {ifp 'store.goodsgroup.edit'}
                <a class="btn btn-primary btn-sm" data-toggle="ajaxModal" href="{php echo webUrl('store/goodsgroup/plusgoods', array('id'=>$id))}" title='添加商品'> 添加商品</a>
                {/if}
            </div>
            <div class="col-sm-6 pull-right">
                <div class="input-group">
                    <input type="text" class="input-sm form-control" name='keyword' value="{$_GPC['keyword']}" placeholder="商品名称"> <span class="input-group-btn">

                    <button class="btn btn-primary" type="submit"> 搜索</button> </span>
                </div>

            </div>
        </div>

    </form>
    {if count($list)>0}
    <div class="page-table-header">
        <input type="checkbox">
        <div class="btn-group">
            {ifp 'store.goodsgroup.edit'}
            <button class="btn btn-default btn-sm btn-operation dropdown-toggle" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{php echo webUrl('store/goodsgroup/deletegoods')}">
                <i class='icow icow-shanchu1'></i> 删除</button>
            {/if}
        </div>
    </div>
    <table class="table table-hover table-responsive">
        <thead class="navbar-inner">
        <tr>
            <th style="width:25px;"></th>
            <th style="width:60px;text-align:center;">logo</th>
            <th >商品</th>
            <th >价格</th>
            <th  style="width: 45px;">操作</th>
        </tr>
        </thead>
        <tbody>
        {loop $list $k $v}
        <tr>
            <td><input type='checkbox'   value="{$v['id']}"/></td>
            <td><img src="{php echo tomedia($v['thumb'])}" style="width:40px;height:40px;padding:1px;border:1px solid #ccc;" onerror="this.src='../addons/mx_shop/static/images/nopic.png'"></td>
            <td >{$v['title']}</td>
            <td>{php echo floatval($v['marketprice']);}</td>
            <td style="overflow:visible;position:relative">
                {ifp 'store.goodsgroup.edit'}
                <a class="btn btn-default btn-sm btn-op btn-operation" data-toggle="ajaxRemove" href="{php echo webUrl('store/goodsgroup/deletegoods',array('id'=>$v['id']));}" data-confirm="确认删除此商品？">
                    <span data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">
                         <i class='icow icow-shanchu1'></i>
                    </span>
                </a>
                {/if}
            </td>
        </tr>
        {/loop}
        </tbody>
        <tfoot>
            <tr>
                <td><input type="checkbox"></td>
                <td colspan="4">
                    <div class="btn-group">
                        {ifp 'store.goodsgroup.edit'}
                        <button class="btn btn-default btn-sm btn-operation dropdown-toggle" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{php echo webUrl('store/goodsgroup/deletegoods')}">
                            <i class='icow icow-shanchu1'></i> 删除
                        </button>
                        {/if}
                    </div>
                </td>
            </tr>
        </tfoot>
    </table>
    {else}
    <div class='panel panel-default'>
        <div class='panel-body' style='text-align: center;padding:30px;'>
            暂时没有任何商品组
        </div>
    </div>
    {/if}
</div>
{template '_footer'}